﻿
//销售退货操作
var columns =
            [
                { display: 'Key', name: 'ID', type: 'text', hide: 1 },
                { display: 'ProductReturnBillID', name: 'ProductReturnBillID', type: 'text', hide: 1 },
                { display: 'StockID', name: 'StockID', type: 'text', hide: 1 },
                { display: '产品类别', name: 'TypeName', mintWidth: 80, width: 120, type: 'text' },
                   { display: '产品名称', name: 'ProductName', mintWidth: 80, width: 160, type: 'text' },
                   { display: '产品编码', name: 'ProductCode', mintWidth: 80, width: 100, type: 'text' },
                    { display: '产品规格', name: 'ProductStandard', mintWidth: 80, width: 200, type: 'text' },
                { display: '退货数量', name: 'ReturnAmount', mintWidth: 100, width: 140, type: 'int' },
                { display: '退货单价', name: 'ReturnPrice', mintWidth: 100, width: 140, type: 'float' },
                { display: '实得数量', name: 'GetCount', mintWidth: 100, width: 140, type: 'int' },
                {display: '备注', name: 'Remarks', mintWidth: 80, width: 140 }
             ];

var manager;
//init controls
$(document).ready(function () {
    intiToobar();
    initligerGrid();
    $("#btnSubmit").unbind("click").bind("click", confirmOperation); //提交
    $("#btnAudit").unbind("click").bind("click", auditOperation); //审核
});

function initligerGrid() {
    manager = null;
    manager = $("#ProductReturntemsGrid").ligerGrid({
        columns: columns,
        //  title: '销售退货细',//不能要标题，修改的BUG，不在ligerui.min.js文件中，所以这个BUG还是存在
        showTitle: false,
        width: '100%',
        enabledSort: true,
        enabledEdit: true,
        checkbox: false,
        rownumbers: true,
        url: "../ProductReturn/GetJsonOfBillDetails?billId=" + $("#Id").val() + "&rand=" + Math.random()
    });
}




function intiToobar() {
    $("#toptoolbar").ligerToolBar({ items: [
                { text: '销售退货信息管理', icon: 'add' }
            ]
    });
}

